package com.bTrace;

import org.openjdk.btrace.core.annotations.BTrace;
import org.openjdk.btrace.core.annotations.OnTimer;

import static org.openjdk.btrace.core.BTraceUtils.Sys.Memory.heapUsage;
import static org.openjdk.btrace.core.BTraceUtils.Sys.Memory.nonHeapUsage;
import static org.openjdk.btrace.core.BTraceUtils.Threads.deadlocks;
import static org.openjdk.btrace.core.BTraceUtils.println;

/**
 * 描述:
 *
 * @author luzhongfu
 * Created by lucky on 2020-08-31 4:31 PM
 */
@BTrace
public class DeBugDeadLock {

    @OnTimer(1000)
    public static void run(){
        deadlocks();
    }

    @OnTimer(4000)
    public static void traceMemory() {
        println("heap:");
        println(heapUsage());
        println("no-heap:");
        println(nonHeapUsage());
    }
}
